#include <iostream>
#include <cstdlib>
#include "Vector.h"
#include "Matrix.h"
#include "ConsoleInterface.h"

void init() {
	std::cout.setf( std::ios_base::fixed, std::ios_base::floatfield );
    std::cout.precision( 4 );
}

int main () {
	init();	

	for( ;; )
	{
		std::cout << "=================================MAIN MENU=================================" << std::endl;
		std::cout << "Enter 1 - to work with vectors, 2 - to work with matrixs"                    << std::endl;
		std::cout << "3 - to solve the system of linear equations, 0 - to EXIT FROM PROGRAM"       << std::endl;
		std::cout << "COMMENT: This program is not as useful as you'd expect. Your misconception"  << std::endl;
		std::cout << "about her is a competent product marketing and PR. However, you will bring"  << std::endl;
		std::cout << "pleasure to the author the using of this product, and add one point"		   << std::endl;
		std::cout << "to his karma."															   << std::endl;
		std::cout << "===========================================================================" << std::endl;
		int workMode;
		std::cin >> workMode;
		cinCheck ();

		try {
			switch (workMode)
			{
			case 0:
				std::cout << "MESSAGE: Work is completed. Press any key to exit." << std::endl;
				return EXIT_SUCCESS;
				break;
			case 1:
				workWithVectors ();
				break;
			case 2:
				workWithMatrixs ();
				break;
			case 3:
				workWithEqules();
				break;

			default:
				std::cout << "Incorrect value. Enter value in range [0, 3]" << std::endl;
				std::cin.clear();
				std::cin.sync();
				break;
			}	
		} catch( std::exception& e ) {
			std::cout << e.what() << std::endl;
		}
	}
}